package org.tinyweb.render;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RedirectRender extends Render {
    private static final Logger LOGGER = LoggerFactory.getLogger(RedirectRender.class);
    private String url;
    
    public RedirectRender(String url){
        this.url = url;
    }
    
    @Override
    public void render() {
        try {
            response.sendRedirect(url);
        } catch (IOException e) {
            LOGGER.error(e.getMessage(), e);
        }
    }
    
}
